import { defineStore } from 'pinia'
import axios from 'axios'
import { ImageProps } from './utils'
export interface UserDataProps {
  nickName?: string;
  _id?: string;
  column?: string;
  email?: string;
  avatar?: ImageProps;
  description?: string;
}

export interface UserProps {
  token: string;
  isLogin: boolean;
  data: UserDataProps | null;
}

export const useUserStore = defineStore('user',{
  state: (): UserProps => {
    return {
      token: localStorage.getItem('token') || '',
      isLogin: false,
      data: null
    }
  },
  actions: {
    /* async login(email: string, password: string) {
      const payload = {
        email,
        password
      }
    }, */
  }
})